<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>行内绑定事件</title>
		<style type="text/css">
			div{
				width: 200px;
				height: 200px;
				background: pink;
				margin-top: 20px;
			}
		</style>
		<script>
			//鼠标单击事件
			function clickMe(){
				alert("哈哈哈~~~~");
			}
			//鼠标移动到div
			function overColor(obj){
				obj.style.backgroundColor="red";
			}
			//鼠标移出div
			function outColor(obj){
				obj.style.backgroundColor="yellow";
			}
		</script>
	</head>
	<body>
		<!--当鼠标单击按钮时弹出对话框-->
		<button type="button" onclick="clickMe()">点我呀！！</button>
		<!--当鼠标移动到div中时改变div的背景色为红色,移出时变成黄色-->
		<div onmouseover="overColor(this)" onmouseout="outColor(this)">将鼠标移动到该区域,然后在移出</div>
	</body>
</html>
